package cl.encrypt;

import java.io.UnsupportedEncodingException;

public class Encriptacion {
	public static String desencriptar(String encriptado){
		byte[] bytes = org.apache.commons.codec.binary.Base64.decodeBase64(encriptado);
		try {
			return new String(bytes, "UTF-8");
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
			return null;
		}
		
	}
	
	public static String encriptar(String desencriptado) {
		byte[] bytes = org.apache.commons.codec.binary.Base64.decodeBase64(desencriptado);
		try {
			return new String(bytes, "UTF-8");
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
			return null;
		}
	}

}
